<?php

namespace app\api\validate\user;

use app\common\enum\user\UserFollowTypeEnum;
use think\Validate;
use function __;

class UserFollowValidate extends Validate
{
    protected $failException = true;

    protected $rule = [
        'user_id' => 'require',
        'type' => 'require|enum:'.UserFollowTypeEnum::class,
    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'follow' => ['user_id', 'type'],
    ];

    public function __construct()
    {
        $this->field = [
            'user_id' => __('content'),
            'type' => __('type'),
        ];
        parent::__construct();
    }

}